package com.xiashitech.apiservice.plugin.base;

import java.util.ArrayList;
import java.util.List;
import java.util.ServiceLoader;

public class BaseGenerator {
    protected static <S> List<S> getService(Class<S> serviceClass) {
        ServiceLoader<S> serviceLoader = ServiceLoader.load(serviceClass);
        List<S> services = new ArrayList<S>();
        for (S service:serviceLoader) {
            services.add(service);
        }
        return services;
    }
}
